package org.example.log.controller;

import org.example.log.dto.SaveLogDto;
import org.example.log.service.SaveLoggingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.io.IOException;

/**
 * @author hero生仔
 * @date 2025/8/2
 */
@RestController
@RequestMapping("/save-logging")
public class SaveLoggingController {

    @Autowired
    private SaveLoggingService loggingService;

    @PostMapping("/save-datas")
    public void saveLoggingTask(@Valid @RequestBody SaveLogDto saveLogDto) throws IOException {
        loggingService.saveLoggingTask(saveLogDto);
    }
}
